package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the SERVICE_WAY database table.
 * 
 */
@Entity
@Table(name="SERVICE_WAY")
@NamedQuery(name="ServiceWay.findAll", query="SELECT s FROM ServiceWay s")
public class ServiceWay implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="SERVICE_WAY_SERVICEWAYID_GENERATOR", sequenceName="SEQ_47")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SERVICE_WAY_SERVICEWAYID_GENERATOR")
	@Column(name="SERVICE_WAY_ID")
	private long serviceWayId;

	@Column(name="SERVICE_WAY_CONTAIN")
	private String serviceWayContain;

	//bi-directional many-to-one association to CustomRecord
	@OneToMany(mappedBy="serviceWay")
	private List<CustomRecord> customRecords;

	public ServiceWay() {
	}
	public ServiceWay(long serviceWayId, String serviceWayContain) {
		super();
		this.serviceWayId = serviceWayId;
		this.serviceWayContain = serviceWayContain;
	}
	@Override
	public String toString() {
		return "ServiceWay [serviceWayId=" + serviceWayId + ", serviceWayContain=" + serviceWayContain + "]";
	}
	
	
	
	
	public long getServiceWayId() {
		return this.serviceWayId;
	}

	public void setServiceWayId(long serviceWayId) {
		this.serviceWayId = serviceWayId;
	}

	public String getServiceWayContain() {
		return this.serviceWayContain;
	}

	public void setServiceWayContain(String serviceWayContain) {
		this.serviceWayContain = serviceWayContain;
	}

	public List<CustomRecord> getCustomRecords() {
		return this.customRecords;
	}

	public void setCustomRecords(List<CustomRecord> customRecords) {
		this.customRecords = customRecords;
	}

	public CustomRecord addCustomRecord(CustomRecord customRecord) {
		getCustomRecords().add(customRecord);
		customRecord.setServiceWay(this);

		return customRecord;
	}

	public CustomRecord removeCustomRecord(CustomRecord customRecord) {
		getCustomRecords().remove(customRecord);
		customRecord.setServiceWay(null);

		return customRecord;
	}

}